package com.lagou.ipersistence.reflection.wrapper;

import com.lagou.ipersistence.reflection.MetaObject;
import com.lagou.ipersistence.reflection.property.PropertyTokenizer;

import java.util.Map;

/**
 * @author Yan Jiahong
 * Created on 2020/11/22
 */
public class MapWrapper extends BaseWrapper {
    private final Map<String, Object> map;

    public MapWrapper(MetaObject metaObject, Map<String, Object> map) {
        super(metaObject);
        this.map = map;
    }

    @Override
    public Object get(PropertyTokenizer prop) {
        return map.get(prop.getName());
    }

    @Override
    public boolean hasSetter(String name) {
        return false;
    }

    @Override
    public Class<?> getSetterType(String name) {
        return null;
    }

    @Override
    public void set(PropertyTokenizer prop, Object value) {

    }
}
